COMPILER = g++
CCFLAGS = -g -ansi -I./ -I../common -I/usr/include/qt4/QtCore -I/usr/include/qt4 -DDATA_COUNT=100
LIBFLAGS = -lQtCore ../common/common.o

all: test


# A rule that runs the unit tests
run_tests: test
	./test
    
%.o : %.cpp
	$(COMPILER) $(CCFLAGS) -c $<

objects = NetworkTest.o runner.o Server.o Client.o Viewer.o

test: $(objects)
	${COMPILER} -o test $(objects) ${LIBFLAGS}

   
MyTestClass.o: MyTestClass.cpp
runner.o: runner.cpp
Server.o: Server.h Server.cpp
Client.o: Client.h Client.cpp
Viewer.o: Viewer.h Viewer.cpp

# How to generate the test runner
runner.cpp: NetworkTest.h
	./cxxtestgen.pl --have-eh -o $@ --error-printer $^

clean:
	rm $(objects) test
re: clean all
